home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / latex.lang < prev    next >
Extensible Markup Language  |  2009-10-02  |  11KB  |  289 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.  
  4.  Author: Marco Barisione <barisione@gmail.com>
  5.  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="latex" _name="LaTeX" version="2.0" _section="Markup">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-tex</property>
  26.     <property name="globs">*.tex;*.ltx;*.sty;*.cls;*.dtx;*.ins;*.bbl</property>
  27.     <property name="line-comment-start">%</property>
  28.   </metadata>
  29.  
  30.   <styles>
  31.     <style id="comment"            _name="Comment"    map-to="def:comment"/>
  32.     <style id="documentclass"      _name="Comment"    map-to="def:keyword"/>
  33.     <style id="usepackage"         _name="Comment"    map-to="def:keyword"/>
  34.     <style id="newcommand"         _name="Comment"    map-to="def:keyword"/>
  35.     <style id="display-math"       _name="Math Mode"/>
  36.     <style id="inline-math"        _name="Inline Math Mode" map-to="latex:display-math"/>
  37.     <style id="structure"          _name="Inline Math Mode"/>
  38.     <style id="section"            _name="Inline Math Mode"/>
  39.     <style id="math"               _name="Math Mode" map-to="latex:display-math"/>
  40.     <style id="math-bound"         _name="math-bound" map-to="latex:display-math"/>
  41.     <style id="include"            _name="Include"    map-to="def:keyword"/>
  42.     <style id="common-commands"    _name="Command"    map-to="def:keyword"/>
  43.     <style id="command"            _name="Command"    map-to="def:keyword"/>
  44.     <style id="verbatim"           _name="Verbatim"   map-to="def:comment"/>
  45.   </styles>
  46.  
  47.   <definitions>
  48.         <context id="common-commands" style-ref="common-commands">
  49.             <prefix>\\</prefix>
  50.  
  51.             <keyword>Alpha</keyword>
  52.             <keyword>Beta</keyword>
  53.             <keyword>Chi</keyword>
  54.             <keyword>Delta</keyword>
  55.             <keyword>Epsilon</keyword>
  56.             <keyword>Eta</keyword>
  57.             <keyword>Gamma</keyword>
  58.             <keyword>Iota</keyword>
  59.             <keyword>Kappa</keyword>
  60.             <keyword>Lambda</keyword>
  61.             <keyword>Leftarrow</keyword>
  62.             <keyword>Leftrightarrow</keyword>
  63.             <keyword>Mu</keyword>
  64.             <keyword>Nu</keyword>
  65.             <keyword>Omega</keyword>
  66.             <keyword>Phi</keyword>
  67.             <keyword>Pi</keyword>
  68.             <keyword>Psi</keyword>
  69.             <keyword>Rho</keyword>
  70.             <keyword>Rightarrow</keyword>
  71.             <keyword>Sigma</keyword>
  72.             <keyword>Tau</keyword>
  73.             <keyword>Zeta</keyword>
  74.             <keyword>alpha</keyword>
  75.             <keyword>appendix</keyword>
  76.             <keyword>begin</keyword>
  77.             <keyword>beta</keyword>
  78.             <keyword>bigcap</keyword>
  79.             <keyword>bigcup</keyword>
  80.             <keyword>cap</keyword>
  81.             <keyword>cdot</keyword>
  82.             <keyword>chapter</keyword>
  83.             <keyword>chi</keyword>
  84.             <keyword>cup</keyword>
  85.             <keyword>delta</keyword>
  86.             <keyword>documentclass</keyword>
  87.             <keyword>end</keyword>
  88.             <keyword>enumi</keyword>
  89.             <keyword>enumii</keyword>
  90.             <keyword>enumiii</keyword>
  91.             <keyword>enumiv</keyword>
  92.             <keyword>epsilon</keyword>
  93.             <keyword>equation</keyword>
  94.             <keyword>eta</keyword>
  95.             <keyword>exists</keyword>
  96.             <keyword>figure</keyword>
  97.             <keyword>footnote</keyword>
  98.             <keyword>footnotemark</keyword>
  99.             <keyword>footnotetext</keyword>
  100.             <keyword>forall</keyword>
  101.             <keyword>gamma</keyword>
  102.             <keyword>geq</keyword>
  103.             <keyword>in</keyword>
  104.             <keyword>int</keyword>
  105.             <keyword>iota</keyword>
  106.             <keyword>kappa</keyword>
  107.             <keyword>label</keyword>
  108.             <keyword>lambda</keyword>
  109.             <keyword>ldots</keyword>
  110.             <keyword>leftarrow</keyword>
  111.             <keyword>leq</keyword>
  112.             <keyword>mpfootnote</keyword>
  113.             <keyword>mu</keyword>
  114.             <keyword>neq</keyword>
  115.             <keyword>newcommand</keyword>
  116.             <keyword>newenvironment</keyword>
  117.             <keyword>newfont</keyword>
  118.             <keyword>newtheorem</keyword>
  119.             <keyword>not</keyword>
  120.             <keyword>notin</keyword>
  121.             <keyword>nu</keyword>
  122.             <keyword>omega</keyword>
  123.             <keyword>onecolumn</keyword>
  124.             <keyword>page</keyword>
  125.             <keyword>pageref</keyword>
  126.             <keyword>paragraph</keyword>
  127.             <keyword>part</keyword>
  128.             <keyword>phi</keyword>
  129.             <keyword>pi</keyword>
  130.             <keyword>prod</keyword>
  131.             <keyword>psi</keyword>
  132.             <keyword>qquad</keyword>
  133.             <keyword>quad</keyword>
  134.             <keyword>ref</keyword>
  135.             <keyword>rho</keyword>
  136.             <keyword>rightarrow</keyword>
  137.             <keyword>section</keyword>
  138.             <keyword>setminus</keyword>
  139.             <keyword>sigma</keyword>
  140.             <keyword>subparagraph</keyword>
  141.             <keyword>subsection</keyword>
  142.             <keyword>subset</keyword>
  143.             <keyword>subseteq</keyword>
  144.             <keyword>subsetneq</keyword>
  145.             <keyword>subsubsection</keyword>
  146.             <keyword>subsubsubsection</keyword>
  147.             <keyword>sum</keyword>
  148.             <keyword>supset</keyword>
  149.             <keyword>supseteq</keyword>
  150.             <keyword>supsetneq</keyword>
  151.             <keyword>table</keyword>
  152.             <keyword>tau</keyword>
  153.             <keyword>times</keyword>
  154.             <keyword>twocolumn</keyword>
  155.             <keyword>varepsilon</keyword>
  156.             <keyword>varphi</keyword>
  157.             <keyword>zeta</keyword>
  158.         </context>
  159.  
  160.         <context id="specials-symbol" style-ref="command">
  161.             <prefix>\\</prefix>
  162.             <suffix></suffix>
  163.  
  164.             <keyword>\$</keyword>
  165.             <keyword>&</keyword>
  166.             <keyword>%</keyword>
  167.             <keyword>#</keyword>
  168.             <keyword>_</keyword>
  169.             <keyword>\{</keyword>
  170.             <keyword>\}</keyword>
  171.             <keyword>~</keyword>
  172.             <keyword>\^</keyword>
  173.             <keyword>\\</keyword>
  174.         </context>
  175.  
  176.         <context id="command" style-ref="command">
  177.             <match>\\[a-zA-Z]+</match>
  178.         </context>
  179.  
  180.         <context id="in-math">
  181.             <include>
  182.                 <context ref="common-commands"/>
  183.                 <context ref="specials-symbol"/>
  184.                 <context ref="command"/>
  185.             </include>
  186.         </context>
  187.  
  188.         <context id="in-inline-math">
  189.             <include>
  190.                 <context ref="common-commands"/>
  191.                 <context ref="specials-symbol"/>
  192.                 <context ref="command"/>
  193.             </include>
  194.         </context>
  195.  
  196.         <context id="latex">
  197.             <include>
  198.  
  199.                 <context id="comment" style-ref="comment">
  200.                     <start>%</start>
  201.                     <end>$</end>
  202.                     <include>
  203.                         <context ref="def:in-comment"/>
  204.                     </include>
  205.                 </context>
  206.  
  207.                 <context id="verbatim-comment" style-ref="comment">
  208.                     <start>\\begin\{comment\}</start>
  209.                     <end>\\end\{comment\}</end>
  210.                     <include>
  211.                         <context ref="def:in-comment"/>
  212.                     </include>
  213.                 </context>
  214.  
  215.                 <context id="math-1" style-ref="math">
  216.                     <start>\$\$</start>
  217.                     <end>\$\$</end>
  218.                     <include>
  219.                         <context sub-pattern="0" where="start" style-ref="math-bound"/>
  220.                         <context sub-pattern="0" where="end" style-ref="math-bound"/>
  221.                         <context ref="in-math"/>
  222.                     </include>
  223.                 </context>
  224.  
  225.                 <context id="math-2" style-ref="math">
  226.                     <start>\\\[</start>
  227.                     <end>\\\]</end>
  228.                     <include>
  229.                         <context sub-pattern="0" where="start" style-ref="math-bound"/>
  230.                         <context sub-pattern="0" where="end" style-ref="math-bound"/>
  231.                         <context ref="in-math"/>
  232.                     </include>
  233.                 </context>
  234.  
  235.                 <context id="inline-math-1" style-ref="inline-math">
  236.                     <start>\$</start>
  237.                     <end>\$</end>
  238.                     <include>
  239.                         <context sub-pattern="0" where="start" style-ref="math-bound"/>
  240.                         <context sub-pattern="0" where="end" style-ref="math-bound"/>
  241.                         <context ref="in-inline-math"/>
  242.                     </include>
  243.                 </context>
  244.  
  245.                 <context id="inline-math-2" style-ref="inline-math">
  246.                     <start>\\\(</start>
  247.                     <end>\\\)</end>
  248.                     <include>
  249.                         <context sub-pattern="0" where="start" style-ref="math-bound"/>
  250.                         <context sub-pattern="0" where="end" style-ref="math-bound"/>
  251.                         <context ref="in-inline-math"/>
  252.                     </include>
  253.                 </context>
  254.  
  255.                 <context id="verbatim-env" style-ref="verbatim">
  256.                     <start extended="true">
  257.                         \\begin\{
  258.                             (
  259.                                 verbatim\*?|
  260.                                 lstlisting|
  261.                                 alltt
  262.                             )
  263.                         \}
  264.                     </start>
  265.                     <end>\\end\{\%{1@start}\}</end>
  266.                 </context>
  267.  
  268.                 <context id="verbatim-inline" style-ref="verbatim">
  269.                     <start>\\(verb\*?|lstinline)(\S)</start>
  270.                     <end>\%{2@start}</end>
  271.                 </context>
  272.  
  273.                 <context id="include" style-ref="include">
  274.                     <prefix>\\</prefix>
  275.  
  276.                     <keyword>input</keyword>
  277.                     <keyword>include</keyword>
  278.                     <keyword>includeonly</keyword>
  279.                     <keyword>usepackage</keyword>
  280.                 </context>
  281.  
  282.                 <context ref="common-commands"/>
  283.                 <context ref="specials-symbol"/>
  284.                 <context ref="command"/>
  285.             </include>
  286.         </context>
  287.   </definitions>
  288. </language>
  289.